package com.example.demo.interceptor;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;

@Configuration
public class ApiInterceptor extends WebMvcConfigurationSupport {
    /**
     * jsp路径映射
     * @param
     */
    @Bean
    public InternalResourceViewResolver viewResolver(){
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setPrefix("/admin/");
        viewResolver.setSuffix(".html");
        viewResolver.setViewClass(JstlView.class);
        return  viewResolver;
    }

}
